home *** CD-ROM | disk | FTP | other *** search
/ PC PowerPlay 58 / pcpp58a.iso / extras / quake 3 source / Q3A_ToolSource.exe / Main / PatchDensityDlg.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  2001-01-02  |  1.6 KB  |  69 lines

  1. // PatchDensityDlg.cpp : implementation file
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include "Radiant.h"
  6. #include "PatchDensityDlg.h"
  7.  
  8. #ifdef _DEBUG
  9. #define new DEBUG_NEW
  10. #undef THIS_FILE
  11. static char THIS_FILE[] = __FILE__;
  12. #endif
  13.  
  14. /////////////////////////////////////////////////////////////////////////////
  15. // CPatchDensityDlg dialog
  16.  
  17.  
  18. CPatchDensityDlg::CPatchDensityDlg(CWnd* pParent /*=NULL*/)
  19.     : CDialog(CPatchDensityDlg::IDD, pParent)
  20. {
  21.     //{{AFX_DATA_INIT(CPatchDensityDlg)
  22.     //}}AFX_DATA_INIT
  23. }
  24.  
  25.  
  26. void CPatchDensityDlg::DoDataExchange(CDataExchange* pDX)
  27. {
  28.     CDialog::DoDataExchange(pDX);
  29.     //{{AFX_DATA_MAP(CPatchDensityDlg)
  30.     DDX_Control(pDX, IDC_COMBO_WIDTH, m_wndWidth);
  31.     DDX_Control(pDX, IDC_COMBO_HEIGHT, m_wndHeight);
  32.     //}}AFX_DATA_MAP
  33. }
  34.  
  35.  
  36. BEGIN_MESSAGE_MAP(CPatchDensityDlg, CDialog)
  37.     //{{AFX_MSG_MAP(CPatchDensityDlg)
  38.     //}}AFX_MSG_MAP
  39. END_MESSAGE_MAP()
  40.  
  41. /////////////////////////////////////////////////////////////////////////////
  42. // CPatchDensityDlg message handlers
  43.  
  44. int g_nXLat[] = {3,5,7,9,11,13,15};
  45.  
  46. void CPatchDensityDlg::OnOK() 
  47. {
  48.   int nWidth = m_wndWidth.GetCurSel();
  49.   int nHeight = m_wndHeight.GetCurSel();
  50.  
  51.   if (nWidth >= 0 && nWidth <= 6 && nHeight >= 0 && nHeight <= 6)
  52.   {
  53.       Patch_GenericMesh(g_nXLat[nWidth], g_nXLat[nHeight], g_pParentWnd->ActiveXY()->GetViewType());
  54.     Sys_UpdateWindows(W_ALL);
  55.   }
  56.  
  57.   CDialog::OnOK();
  58. }
  59.  
  60. BOOL CPatchDensityDlg::OnInitDialog() 
  61. {
  62.     CDialog::OnInitDialog();
  63.  
  64.   m_wndWidth.SetCurSel(0);
  65.   m_wndHeight.SetCurSel(0);
  66.     return TRUE;  // return TRUE unless you set the focus to a control
  67.                   // EXCEPTION: OCX Property Pages should return FALSE
  68. }
  69.